import React, { Component } from "react";
import FilmSon from "./films/FilmSon";
import ComingSoon from "./films/ComingSoon";

import { Redirect, Route, Switch } from "react-router-dom";
export default class films extends Component {
  render() {
    return (
      <div>
        <div style={{ height: "200px", background: "yellow" }}>大轮播</div>
        <div>导航栏</div>
        {/* 嵌套路由 写在对应的父组件中进行配置 最好额外新建子文件夹 */}
        <Switch>
          {/* 写在路由里面 父组件是路由不是 film 了 */}
          <Route path="/films/filmson" component={FilmSon}></Route>
          <Route path="/films/comingsoon" component={ComingSoon}></Route>

          <Redirect from="/films" to="/films/comingsoon"></Redirect>
        </Switch>
      </div>
    );
  }
}
